<template>
    <div>
        <el-breadcrumb>
            <el-breadcrumb-item>首页</el-breadcrumb-item>
            <el-breadcrumb-item v-breadcrumb-certify></el-breadcrumb-item>
        </el-breadcrumb>
        <div class="content">
            <e-heading>查看赛事</e-heading>
            <match-list v-if="race_list&& race_list.list && race_list.list.length" :data="race_list.list"/>
            <e-placeholder v-else text="还没有发布过赛事噢" ></e-placeholder>
            <el-pagination
              v-bind="getPaginationProps(race_list)"
              @current-change="handleCurrentChange"
              @size-change="handleSizeChange">
            </el-pagination>
        </div>
    </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import MatchList from './components/MatchList'
  import { pagingList } from 'utils/mixins'
  export default{
    mixins: [pagingList],
    components: {
      MatchList
    },
    computed: {
      ...mapGetters({
        race_list: 'race_list'
      })
    },
    data () {
      return {
        query: this.getQuery()
      }
    },
    methods: {
      goItem (item) {
        this.$store.commit('SET_MATCHID', item.id)
        this.$router.push({path: '/race/detail/index'})
      },
      fetch (query) {
        this.$store.dispatch('race_list', query)
      }
    }
  }
</script>
<style>

</style>
